import xadmin

from .models import AgreeOppositeAnwser, FollowProblem, FollowUser, FavAnswer, ShareAnswer, \
    ShareProblem, ShareUser, Invitation, ProblemToTag


class FollowProblemAdmin(object):
    list_display = ['problem', 'user', 'add_time']
    list_filter = ['problem', 'user']
    search_fields = ['problem', 'user', 'add_time']
    # model_icon='fa '


class FollowUserAdmin(object):
    list_display = ['follow_user', 'user', 'add_time']
    list_filter = ['follow_user', 'user']
    search_fields = ['follow_user', 'user', 'add_time']
    # model_icon='fa '


class FavAmswerAdmin(object):
    list_display = ['answer', 'user', 'add_time']
    list_filter = ['answer', 'user']
    search_fields = ['answer', 'user', 'add_time']
    # model_icon='fa '


class AgreeAnswerAdmin(object):
    list_display = ['answer', 'user', 'add_time']
    list_filter = ['answer', 'user']
    search_fields = ['answer', 'user', 'add_time']
    # model_icon='fa '


class ShareAnswerAdmin(object):
    list_display = ['answer', 'user', 'add_time']
    list_filter = ['answer', 'user']
    search_fields = ['answer', 'user', 'add_time']
    # model_icon='fa '


class ShareProblemAdmin(object):
    list_display = ['problem', 'user', 'add_time']
    list_filter = ['content', 'user']
    search_fields = ['problem', 'user', 'add_time']
    # model_icon='fa '


class ShareUserAdmin(object):
    list_display = ['share_user', 'user', 'add_time']
    list_filter = ['share_user', 'user']
    search_fields = ['share_user', 'user', 'add_time']
    # model_icon='fa '


class InvitationAdmin(object):
    list_display = ['problem', 'invite_user', 'user', 'add_time']
    list_filter = ['problem', 'invite_user', 'user', ]
    search_fields = ['problem', 'invite_user', 'user', 'add_time']
    # model_icon='fa '


class ProblemToTagAdmin(object):
    list_display = ['user', 'tag', 'problem', 'add_time']
    list_filter = ['user', 'tag', 'problem']
    search_fields = ['user', 'tag', 'problem', 'add_time']
    # model_icon='fa


xadmin.site.register(FollowProblem, FollowProblemAdmin)
xadmin.site.register(FollowUser, FollowUserAdmin)
xadmin.site.register(FavAnswer, FavAmswerAdmin)
xadmin.site.register(AgreeOppositeAnwser, AgreeAnswerAdmin)
xadmin.site.register(ShareAnswer, ShareAnswerAdmin)
xadmin.site.register(ShareProblem, ShareProblemAdmin)
xadmin.site.register(ShareUser, ShareUserAdmin)
xadmin.site.register(Invitation, InvitationAdmin)
xadmin.site.register(ProblemToTag, ProblemToTagAdmin)
